package com.hnas.trade.domain;

import java.util.HashMap;
import java.util.Map;

import com.hnas.core.util.StringUtil;

public enum BusinessType {

	BuyGasoline("01","加油");

	private String type;
	private String description;
	
	private static Map<String,String> map = new HashMap<String,String>();

	private BusinessType(String type, String description) {
		this.type = type;
		this.description = description;
	}
	
	static{
		for(BusinessType bt : BusinessType.values()){
			map.put(bt.type, bt.description);
		}
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public static String getBusinessTypeStr(String type){
		if(StringUtil.isEmpty(type)) return null;
		for(BusinessType ot : BusinessType.values()){
			if(ot.type.equals(type)){
				return ot.getDescription();
			}
		}
		return null;
	}
	
	public static Map<String,String> getMap(){
		return map;
	}
}
